Skip to content

Add test for deadtime and event time-difference distributions to Acceptance Verification#311

Merged
jlenain merged 11 commits into
cta-observatory:mainfrom
alessandromontanari:av-deadtime-event-time-diff-distr
Jun 17, 2026
Merged

Add test for deadtime and event time-difference distributions to Acceptance Verification#311
jlenain merged 11 commits into
cta-observatory:mainfrom
alessandromontanari:av-deadtime-event-time-diff-distr

Conversation

@alessandromontanari

Copy link
Copy Markdown
Contributor

feat(src/nectarchain/acceptance_verification_package):

  • gui.py: refactor to add deadtime test
  • deadtime.py: implement placeholder for deadtime test following TRR test suite logic

This PR will implement the test to plot deadtime and event time-difference distributions for the acceptance verification on site. It follows the logic already implemented for the TRR test suite.

- gui.py: refactor to add deadtime test

- deadtime.py: implement placeholder for deadtime test following TRR test suite logic
@alessandromontanari alessandromontanari self-assigned this May 4, 2026
@alessandromontanari alessandromontanari added the enhancement New feature or request label May 4, 2026
@codecov

codecov Bot commented May 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 12.98701% with 67 lines in your changes missing coverage. Please review.
✅ Project coverage is 45.87%. Comparing base (bcb16b2) to head (753b770).
⚠️ Report is 12 commits behind head on main.

Files with missing lines Patch % Lines
src/nectarchain/trr_test_suite/deadtime.py 14.51% 53 Missing ⚠️
src/nectarchain/trr_test_suite/tools_components.py 0.00% 10 Missing ⚠️
src/nectarchain/trr_test_suite/utils.py 20.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #311      +/-   ##
==========================================
- Coverage   49.33%   45.87%   -3.47%     
==========================================
  Files          85       90       +5     
  Lines        7795     8894    +1099     
==========================================
+ Hits         3846     4080     +234     
- Misses       3949     4814     +865     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

- ../trr_test_suite/deadtime.py: fix typo in docstring

- deadtime.py: implement computation and plots for deadtime and event time distributions, following login in trr_test_suite

- resources/source_type_labels.json: add labels and colors for source type, following what defined in ctapipe.containers.EventType
Comment thread src/nectarchain/acceptance_verification_package/deadtime.py Outdated
Alessandro MONTANARI and others added 4 commits May 5, 2026 15:33
- deadtime.py: minor typo fixes, minor refactors in functions to accept acceptance verification inputs

- utils.py: minor refactors in plot_deadtime_and_expo_fit to accept input for acceptance verification

- tools_components.py: refactor in DeadtimeTestTool to extract event_type from ctapipe.containers.EventType
- utils.py: refactor plot_deadtime_and_expo_fit with temporary output for the GUI
- resources/source_type_labels.json: change color for SUBARRAY to pink

- deadtime.py: docstring and refactor few function arguments to display in the GUI
@alessandromontanari

Copy link
Copy Markdown
Contributor Author

Hi @tibaldo, with these last few pushes, this PR satisfies the same requirements as for the TRR deadtime test, and produces the plots for the GUI in acceptance_verification_package. With the CLI:

python deadtime.py --source 0 0 0 0 0 0 0 0 0 0 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 -r 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3347 3348 3349 3350 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 -c NectarCAMQM --evts 4000 --output ./

you can get the plots below:

deadtime_and_expo_fit_3556 deadtime_pc_vs_trigger_rate fitted_vs_collected_trigger_rates

You can also visualise the same plots via the GUI (in which you'll see the distributions for all the runs).

@alessandromontanari alessandromontanari marked this pull request as ready for review May 11, 2026 14:41

@tibaldo tibaldo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ciao @alessandromontanari, thank you very much for proposing this PR! I look through it and I have some questions mostly related to keep consistency across the NectarCAM software and avoid code duplication. Otherwise this looks good to merge to me!

Comment thread src/nectarchain/trr_test_suite/resources/source_type_labels.json
Comment thread src/nectarchain/acceptance_verification_package/deadtime.py Outdated
Comment thread src/nectarchain/acceptance_verification_package/deadtime.py Outdated
Comment thread src/nectarchain/acceptance_verification_package/gui.py Outdated
… add docstring to explain source type labels taken from ctapipe.containers
- deadtime.py: removed

- gui.py: now import deadtime.py from ../trr_test_suite

- ../trr_test_suite/deadtime.py: refactor to accomodate both 'trr' and 'av' tests, and GUI arguments

- source_type_labels.json: moved to ../trr_test_suite/resources
@alessandromontanari

Copy link
Copy Markdown
Contributor Author

Hi @tibaldo and @jlenain,
I removed deadtime.py in acceptance_verification_package, and reworked its cousin in trr_test_suite. Now, the gui.py in acceptance_verification_package imports deadtime.py from trr_test_suite. When you run that GUI, you should get the same results as shown above if you set the test_type argument to 'av'. These latest changes may create conflicts with #277. Nevertheless, I reckon it should not be anything too troublesome. I also moved source_type_labels.json from acceptance_verification_package/resources to trr_test_suite/resources as a temporary solution.

…path to JSON file for labels in get_labels()
@tibaldo

tibaldo commented Jun 17, 2026

Copy link
Copy Markdown
Member

Thank you @alessandromontanari, after the latest changes everything looks good as far as I can tell!

@jlenain jlenain merged commit 9c63af7 into cta-observatory:main Jun 17, 2026
9 of 11 checks passed
@jlenain jlenain deleted the av-deadtime-event-time-diff-distr branch June 17, 2026 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants